import service from '@/utils/crmRequest'

export default () => ({

  // 订单---列表
  GET_ORDER_LIST: function(data) {
    return service({
      url: '/api/order/list',
      method: 'post',
      data
    })
  },

  // 订单---创建
  ORDER_CREATE: function(data) {
    return service({
      url: '/api/order/create',
      method: 'post',
      data
    })
  },

  // 订单---创建
  ORDER_EDIT: function(data) {
    return service({
      url: '/api/order/edit',
      method: 'put',
      data
    })
  },

  // 订单---创建
  ORDER_DELETE: function(id) {
    return service({
      url: '/api/order/deleteById?id=' + id,
      method: 'delete',
    })
  },

  // 发货---列表
  GET_DELIVERY_LIST: function(data) {
    return service({
      url: '/api/delivery/list',
      method: 'post',
      data
    })
  },

  // 发货明细---列表
  GET_DELIVERY_DETAIL_LIST: function(data) {
    return service({
      url: '/api/delivery/detail/list',
      method: 'post',
      data
    })
  },

  // 订单详情
  GET_ORDER_DETAIL: function(id) {
    return service({
      url: '/api/order/detail?id=' + id,
      method: 'get',
    })
  },

  // 取消订单
  ORDER_CANCEL: function(id) {
    return service({
      url: '/api/order/cancel?id=' + id,
      method: 'get',
    })
  },

  // 确认收货
  ORDER_CONFIRM_GOODS: function(id) {
    return service({
      url: '/api/order/confirm/accept/goods?id=' + id,
      method: 'get',
    })
  },

  // 发货详情
  ORDER_DELIVERY_DETAIL: function(id) {
    return service({
      url: '/api/delivery/detail?id=' + id,
      method: 'get',
    })
  },

  // 新建订单-终端列表
  GET_ORDER_TERMINAL_LIST: function() {
    return service({
      url: '/api/relationStandard/order-terminal-down-list',
      method: 'get',
    })
  },

  // 新建订单-配送商列表
  GET_ORDER_DISTRIBUTE_LIST: function() {
    return service({
      url: '/api/order/distribute/list',
      method: 'get',
    })
  },

  // 新建订单-代理列表
  GET_ORDER_AGENT_LIST: function(data) {
    return service({
      url: '/api/relationStandard/order-terminal-agent-down-list',
      method: 'post',
      data
    })
  },

  // 新建订单-产品列表
  GET_ORDER_PRODUCT_LIST: function(data) {
    return service({
      url: '/api/relationStandard/order-terminal-product-down-list',
      method: 'post',
      data
    })
  },

  // 新建订单-产品列表
  ORDER_COMMIT_CHECK: function(id) {
    return service({
      url: '/api/order/commit/check?id=' + id,
      method: 'get',
    })
  },

  // 新建订单-产品列表
  ORDER_DELIVERY_CREATE: function(data) {
    return service({
      url: '/api/delivery/create',
      method: 'post',
      data
    })
  },

  // 订单-查看信用
  ORDER_DETAIL_FINANCE: function(data) {
    return service({
      url: '/api/finance/order/credit',
      method: 'post',
      data
    })
  },

  // 订单-查看信用
  ORDER_DELIVERY_DOWN_LIST: function(data) {
    return service({
      url: '/api/delivery/detail/down/list',
      method: 'post',
      data
    })
  },
})
